﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GPCSC.Webs;
using System.Data;
using System.Collections;
namespace HSYCWeb.web.DOCS
{
    public partial class adminSHED : System.Web.UI.Page
    {
        public string imgurl = "Unull.gif";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string RCID = Usual.f_querystringToString("rcid");
                f_tx(RCID);
                f_sf(RCID);
                f_jl(RCID);
                f_load(RCID);

            }
        }
        
        
        /// <summary>
        ///绑定个人照片 
        /// </summary>
        /// <param name="RCID"></param>
        protected void f_tx(string RCID)
        {
            
            DataSet ds = new DataSet();
            Hashtable htable = new Hashtable();
            htable.Add("@GJRCId", RCID);
            htable.Add("@state", 1);
            ds = new SqlReadXml().ReaderDataSet("sel_usertx_new", htable);
            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        imgurl = ds.Tables[0].Rows[0]["fileUrl"].ToString();
                    }
                }
            }
        }
        /// <summary>
        /// 绑定身份照片
        /// </summary>
        /// <param name="RCID"></param>
        protected void f_sf(string RCID)
        {
            
            DataSet ds = new DataSet();
            Hashtable htable = new Hashtable();
            htable.Add("@GJRCId", RCID);
            htable.Add("@state", 0);
            ds = new SqlReadXml().ReaderDataSet("sel_userGJRCFile_all", htable);
            Repeater5.DataSource = ds;
            Repeater5.DataBind();
        }
        /// <summary>
        /// 绑定学习经历
        /// </summary>
        protected void f_jl(string RCID)
        {
            Hashtable htbale = new Hashtable();
            DataSet ds = new DataSet();
            htbale.Add("@RCID_P", RCID);
            ds = new SqlReadXml().ReaderDataSet("sel_userJLlist_all", htbale);
            //if (ds.Tables[0].Rows.Count > 0)
            //{ 
            //    foreach()
            //}
            Repeater4.DataSource = ds;
            Repeater4.DataBind();
        }
        /// <summary>
        /// 初始化人员信息
        /// </summary>
        protected void f_load(string RCID)
        {
            
            DataSet ds = new DataSet();
            Hashtable htable = new Hashtable();
            htable.Add("@RCID", RCID);
            ds = new SqlReadXml().ReaderDataSet("sel_userRCID_one", htable);
            UIFactory.UIFactory_Set(this, ds.Tables[0]);        
        }

       /// <summary>
       ///审核通过
       /// </summary>
       /// <param name="sender"></param>
       /// <param name="e"></param>
        protected void Button1_Click(object sender, EventArgs e)
        {
            string RCID = Usual.f_querystringToString("rcid");
            string shyj = this.MtxtDsSHYJ.Value;
            Hashtable htable = new Hashtable();

            htable.Add("STATE",1);
            htable.Add("SHYJ", shyj);
            GPCSC.Webs.databyhtable dtable = new GPCSC.Webs.databyhtable();
            dtable.databyhtables(htable, "update", "GJRC", "RCID", RCID);
            this.Response.Write("<script>alert('操作完成！');window.location.href='admSH.aspx';</script>");
        }
        /// <summary>
        /// 审核未通过
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button2_Click(object sender, EventArgs e)
        {
            string RCID = Usual.f_querystringToString("rcid");
            string shyj = this.MtxtDsSHYJ.Value;
            Hashtable htable = new Hashtable();
            htable.Add("SHYJ", shyj);
            htable.Add("STATE", 5);
            GPCSC.Webs.databyhtable dtable = new GPCSC.Webs.databyhtable();
            dtable.databyhtables(htable, "update", "GJRC", "RCID", RCID);
            this.Response.Write("<script>alert('操作完成！');window.location.href='admSH.aspx';</script>");
        }
    }
}